#Requires AutoHotkey v2.0

mySort(arr){
    
    i := 0

    while(i < arr.Length){

       j := 1

       while(j < arr.Length - i){
            if(arr[j] > arr[j + 1]){
                temp := arr[j]
                arr[j] := arr[j + 1]
                arr[j + 1] := temp
            }
            j++
       }
       i++
    }
}

; 示例使用
arr := [5, 3, 9, 3, 5, 1, 3, 5, 7]
mySort(arr)

at := ""
loop arr.Length{
    at .= arr[A_Index] . ","
}
MsgBox at